package databaseVersionControl.domain.ddl;

import databaseVersionControl.domain.db.DBComponent;
import databaseVersionControl.domain.dialect.Dialect;
import databaseVersionControl.domain.script.ExecutableScript;

public abstract class CreateComposite<T extends DBComponent> implements ExecutableScript {
	
	protected T component;
	private final String statement = "CREATE ";
	
	public CreateComposite(T component) {
		this.component = component;
	}

	@Override
	public String sqlInDialect(Dialect dialect) {
		return statement + component.sqlInDialect(dialect);
	}

	@Override
	public String sqlIdentifier() {
		return statement + component.sqlIdentifier();
	}
	
	public abstract CreateComposite<T> ifNotExists();
	public abstract CreateComposite<T> revokeIfNotExists();


}